<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/">
    <xi:include href="master.html" />
    <?python
        from datetime import date
        from mnemoply import model
        from mnemoply.utils import format_date
    ?>
    <head>
        <title>Root Page</title>
    </head>

    <body class="welcome">
        <p>
            Root page. See menu above.
        </p>
        <p>
            You need to install readrds in order to view reports. <br />
            <a href="/readrds">ReadRDS page</a>.
        </p>
        <?python
            news = model.New.select().orderBy('-date')
            last_new = None
            style_class = None
            if news.count():
                last_new = news[0]
            if last_new and date.today() <= last_new.date:
                style_class = 'today'
        ?>
        <h3 py:if="last_new"><a href="/News/">News</a>:</h3>
        <p py:if="last_new" class="${style_class} news">
            ${format_date(last_new.date) + ":" + last_new.content}
        </p>
    </body>
</html>
